<!--
 * @Author: xuxu12138 1718324422@qq.com
 * @Date: 2024-07-03 13:44:55
 * @LastEditors: xuxu12138 1718324422@qq.com
 * @LastEditTime: 2024-07-13 09:29:31
 * @FilePath: /things-admin/src/view/member/AssociatedDevices.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="core_content">
    <div class="header">
      <el-button type="primary" class="el-icon-plus">添加设备</el-button>
    </div>
    <div class="content">
      <Table border :columns="columns" highlight-row :data="data">
        <template #totalTime="{row}">
          {{  Math.ceil(row.totalTime / 60) }}
        </template>
        <template #action="{ row, index }">
          <Button
            type="error"
            size="small"
            style="margin-right: 5px"
            >删除</Button
          >
        </template> </Table>
      <div style="display: flex;justify-content: space-between;margin-top: 20px;"> 
      <div></div>
      <Page :total="total" show-sizer/>
    </div>
    </div>
  </div>
</template>

<script>
import {deviceInformation} from '@/base/api/MemberApi'
export default {
  data() {
    return {
      columns: [
        {
          title: "所属经销商",
          key: "agentName"
        },
        {
          title: "设备编号",
          key: "deviceSn"
        },
        {
          title: "序列号",
          key: "massageSn"
        },
        {
          title: "设备型号",
          key: "modelName"
        },
        {
          title: "设备分类",
          key: "sortName"
        },
        {
          title: "设备状态",
          key: "statusCode"
        },
        {
          title: "最近使用时间",
          key: "statusUpdateTime"
        },
        {
          title: "使用次数",
          key: "totalNum"
        },
        {
          title: "使用时长/分钟",
          slot: "totalTime"
        },
        {
          title: "操作",
          slot: "action",
          fixed:'right'
        }
      ],
      data: [],
      total:0
    };
  },
  mounted() {
    this.deviceInformation()
  },
  methods:{
    deviceInformation() {
      deviceInformation(this.$route.params.id).then(res=>{
           console.log(res.data)
           this.data = res.data
      })
    }
  }
  // deviceInformation
};
</script>

<style lang="less" scoped>
.header {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.content {
  margin-top: 40px;
}
</style>
